package com.gao.recursion;

/**
 * @Author: ShanYuqing
 * @Version: v1.0
 */
public class RecursionDemo2 {
    /*
            猴子吃桃
     */
    public static void main(String[] args) {
        int monkey = monkey(9);
        System.out.println(monkey);
    }
    public  static int monkey(int num){
        if(num==10){
            return 1;
        }else{
            //公式：（后一天的桃子数量+1）*2；
            return (monkey(num+1)+1)*2;
        }
    }
}
